package com.cleaningcloud.cld.service.impl.mini;

import com.cleaningcloud.cld.api.domain.Vo.CldStaffDto;
import com.cleaningcloud.cld.domain.dto.CldAssetsRecordDto;
import com.cleaningcloud.cld.domain.vo.CldAssetsRecordVo;
import com.cleaningcloud.cld.domain.vo.CldAssetsRepairVo;
import com.cleaningcloud.cld.domain.vo.CldStaffVo;
import com.cleaningcloud.cld.mapper.CldAssetsRecordMapper;
import com.cleaningcloud.cld.mapper.CldAssetsRepairMapper;
import com.cleaningcloud.cld.mapper.mini.MiniPersonnelMapper;
import com.cleaningcloud.cld.service.mini.IMiniAssetsService;
import com.cleaningcloud.common.core.web.domain.AjaxResult;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@Service
public class MiniAssetsServiceImpl implements IMiniAssetsService {

    @Autowired
    private CldAssetsRecordMapper cldAssetsRecordMapper;

    @Autowired
    private CldAssetsRepairMapper cldAssetsRepairMapper;

    /**
     * @Author Shaw
     * @Description 获取资产记录信息(小程序-资产记录列表)
     * @date: 2025-05-28 15:58
     * @param: //TODO
     */
    @Override
    public List<CldAssetsRecordVo> getAssetsRecordList(CldAssetsRecordDto cldAssetsRecordDto) {
        return cldAssetsRecordMapper.selectCldAssetsRecordList(cldAssetsRecordDto);
    }

    /**
     * @Author Shaw
     * @Description 获取资产记录详情信息(小程序-资产记录列表)
     * @date: 2025-05-28 15:58
     * @param: //TODO
     */
    @Override
    public CldAssetsRecordVo getAssetsRecordInfo(CldAssetsRecordDto cldAssetsRecordDto) {
        CldAssetsRecordVo cv = cldAssetsRecordMapper.selectCldAssetsRecordList(cldAssetsRecordDto).get(0);
        return cv;
    }

    /**
     * @Author Shaw
     * @Description 获取资产维修配件列表(小程序-资产记录维系配件列表)
     * @date: 2025-06-06 13:58
     * @param: //TODO
     */
    @Override
    public List<CldAssetsRepairVo> getRepairListByAssetsRecordId(Long assetsRecordId) {
        return cldAssetsRepairMapper.getRepairListByAssetsRecordId(assetsRecordId);
    }
}
